<p>When the call to a function doesn't have any side effect, what is the point of ignoring the result of the function call ? In such case, either the function call is useless and should be dropped or the source code doesn't behave as expected. </p>
<p>To prevent generating any false-positives, this rule triggers an issues only on the following predefined list of immutable classes in the Java API : String, Boolean, Integer, Double, Float, Byte, Character, Short, StackTraceElement.</p>
<h2>Noncompliant Code Example</h2>

<pre>
public void handle(String command){
  command.toLowerCase(); // Noncompliant; result of method thrown away
  ...
}
</pre>
<h2>Compliant Solution</h2>

<pre>
public void handle(String command){
  String formattedCommand = command.toLowerCase();
  ...
}
</pre>
<h2>See</h2>

<ul>
<li> MISRA C:2012, 17.7 - The value returned by a function having non-void return type shall be used</li>
<li> <a href="https://www.securecoding.cert.org/confluence/x/9YIRAQ">CERT, EXP12-C</a> - Do not ignore values returned by functions</li>
<li> <a href="https://www.securecoding.cert.org/confluence/x/eoAyAQ">CERT, EXP12-CPP</a> - Do not ignore values returned by functions or methods</li>
</ul>

